CC=g++
INCLUDE=./include
LIB=./lib
SRCDIR=./src
OBJDIR=./obj

all: v8r-globals.o v8r-builtin.o v8r-srchelper.o v8r-stdio.o v8r-main.o v8r

v8r-globals.o:
	$(CC) -I $(INCLUDE) -L $(LIB) -c $(SRCDIR)/v8r-globals.cc -o $(OBJDIR)/v8r-globals.o

v8r-builtin.o:
	$(CC) -I $(INCLUDE) -L $(LIB) -c $(SRCDIR)/v8r-builtin.cc -o $(OBJDIR)/v8r-builtin.o

v8r-srchelper.o:
	$(CC) -I $(INCLUDE) -L $(LIB) -c $(SRCDIR)/v8r-srchelper.cc -o $(OBJDIR)/v8r-srchelper.o

v8r-stdio.o:
	$(CC) -I $(INCLUDE) -L $(LIB) -c $(SRCDIR)/v8r-stdio.cc -o $(OBJDIR)/v8r-stdio.o

v8r-main.o:
	$(CC) -I $(INCLUDE) -L $(LIB) -c $(SRCDIR)/v8r-main.cc -o $(OBJDIR)/v8r-main.o

v8r:
	$(CC) -I $(INCLUDE) -L $(LIB) $(OBJDIR)/*.o -o v8r -lv8 -lpthread

clean:
	-rm $(OBJDIR)/*.o v8r
